//
//  AppDelegate.swift
//  swiftDatatable
//
//  Created by 李朋 on 17/3/13.
//  Copyright © 2017年 李朋. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//        
//        var strTest:[String] = [String]()
//        for i in 0..<1000000 {
//            strTest.append("A\(i)")
//        }
//
//        let str = strTest.filter({$0 == "A50"})
//        
//        
//        print(strTest.filter({$0 == "A50"})[0])
//        
//        let milesToPoint = ["point1":120.0,"point2":50.0,"point3":70.0]
//        let kmToPoint = milesToPoint.map { name,miles in miles * 1.6093 }
//        let name = milesToPoint.map { $0 }
//        let miles = milesToPoint.map { $1 }
//        
//        let ranks = ["J","Q","K","A"]
//        let suits = ["1","2","3","4"]
//        
//        let results = suits.flatMap { suit in
//            ranks.map { rank in
//                (suit, rank)
//            }
//        }
//        
//        let a = addTo(2)
//        let relust = addTo(2)(2)
        
        
//        struct TimesTable {
//            let multiplier: Int
//            subscript(index: Int) -> Int {
//                return multiplier * index
//            }
//        }
        
        
//        let t = TimesTable.init(multiplier: 3)

        
//        let threeTimesTable = TimesTable(multiplier: 3)
//        DLog("3的6倍是\(threeTimesTable[6])")
        // 输出 "3的6倍是18"
        
        
        self.window = UIWindow.init(frame: UIScreen.main.bounds)
        self.window?.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
        self.window?.rootViewController = MainViewController()
        self.window?.makeKeyAndVisible()
        DLog("更新测试")
        return true
    }

}

//
//func addTo(_ adder: Int) -> (Int) -> Int {
//    return {
//        num in
//        return num + adder
//    }
//}

/// 打印日志
func DLog<T>(_ messsage : T, file : String = #file, funcName : String = #function, lineNum : Int = #line) {
    #if DEBUG
        let fileName = (file as NSString).lastPathComponent
        print("\(fileName):(\(lineNum))-\(messsage)")
    #endif
}

